Page({
  data: {
    year: '',
    month: '',
    isLastItem: false
  },
  onLoad: function () {
    this.getDate()
  },
  onShow: function () {

  },
  // 获取日期
  getDate () {
    let d = new Date()
    let year = d.getFullYear()
    let month = d.getMonth() + 1
    this.setData({
      year,
      month
    })
  },
  // 选择日期时触发
  bindDateChange (e) {
    let dateStr = e.detail.value
    let arr = dateStr.split('-')
    this.setData({
      year: arr[0],
      month: arr[1]
    })
  }
})
